﻿#include "Originator.h"
#include <QDebug>

Originator::Originator()
{

}

shared_ptr<Memento> Originator::CreateMemento()
{
    return shared_ptr<Memento>(new Memento(m_state));
}

void Originator::setMemento(shared_ptr<Memento> memento)
{
    m_state = memento->getState();
}

void Originator::show()
{
    qDebug() << QString("State = %1").arg(m_state);
}

const QString &Originator::getState() const
{
    return m_state;
}

void Originator::setState(const QString &state)
{
    m_state = state;
}
